package icu.wdtt.controller;

import cn.dev33.satoken.stp.StpUtil;
import icu.wdtt.Utils.ResultUtils;
import icu.wdtt.enumModel.HttpRequestMessage;
import icu.wdtt.model.Result;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
用于后台
 */
@RestController
@RequestMapping("admin")
@ApiModel(value = "管理员接口",description = "后台管理员使用")
public class AdminController {

    @Autowired
    private ResultUtils resultUtils;


    @GetMapping("isAdmin")
    @ApiOperation(value = "判断是否为管理员",notes = "无")
    public Result isAdmin(){
        return resultUtils.success(HttpRequestMessage.SUCCESS,StpUtil.getSession().get("user"));
    }
}
